#@layout()
#define script()
<script>

    function updatePrice(id) {
        openlayer('手动入账','#(CPATH)/admin/finance/payUpdate/'+id);
    }

    function showDetail(id) {
        openlayer('支付详情','#(CPATH)/admin/finance/payDetail/'+id);
    }

    function openlayer(title,url) {
        layer.open({
            type: 2,
            title: title,
            anim: 2,
            shadeClose: true,
            shade: 0.3,
            area: ['70%', '90%'],
            content: url,
            end: function () {

            }
        });
    }

</script>

#end
#define css()
<style>
    table a{
        color:#007bff;
        font-weight:500;
    }
</style>
#end

#define content()
    <section class="content-header">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6">

                    <div class="row mb-2">
                        <div class="col-sm-12">
                            <h1>
                                支付记录
                                <small data-toggle="tooltip" title="" data-placement="right"
                                       data-trigger="hover"><i class="nav-icon far fa-question-circle"></i></small>
                                <small> 首页 / 财务 / 支付记录</small>
                            </h1>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-12" style="padding-top: 20px">
                            <a href="#(CPATH)/admin/finance/paylist">全部 (#(totalCount ?? 0))</a> |
                            <a href="?status=9">支付成功 (#(successCount ?? 0))</a> |
                            <a href="?status=1">支付中 (#(prepayCount ?? 0))</a> |
                            <a href="?status=2" style="color: #a00">支付失败 (#(failCount ?? 0))</a>
                        </div>
                    </div>

                </div>

            </div>

        </div><!-- /.container-fluid -->
    </section>


    <section class="content">

        <div class="container-fluid">
                <div class="card card-outline card-primary">
                    <div class="card-header with-border">
                        <form class=" admin-search-panel" action="" method="get">
                            <input type="hidden" name="status" value="#para('status')">
                            <div class="row">
                                <div class="form-group col-lg-2">
                                        <input type="text" placeholder="流水号" class="form-control" name="ns" value="#para('ns')">
                                </div>
                                <div class="form-group col-lg-2">
                                        <input type="text" placeholder="产品" class="form-control" name="pt" value="#para('pt')">
                                </div>
                                <div class="form-group col-lg-2">
                                        <button type="submit" class="btn btn-primary ">查询</button>
                                        <button type="reset" class="btn btn-default">重置</button>
                                </div>
                            </div>
                            <!-- /.card-body -->
                        </form>


                    </div>
                    <!-- /.card-header -->
                    <div class="card-body p-0">

                        <table class="table table-striped">
                            <tbody>
                            <tr>

                                <th style="width: 150px">流水号</th>
                                <th style="width: 50px">金额</th>
                                <th style="width: 150px">产品名称</th>
                                <th>支付用户</th>
                                <th>支付类型</th>
                                <th style="width: 150px">支付状态</th>
                                <th style="width: 80px">操作</th>
                            </tr>

                            #for(payment : page.list ??)
                            <tr>
                                <td>
                                    #(payment.trx_no ??)
                                </td>
                                <td>
                                    #number(payment.pay_amount,"0.00")
                                </td>
                                <td>
                                    #(payment.product_title ??)
                                </td>
                                <td>
                                    #(payment.payer_name ??)
                                </td>
                                <td>
                                    #(payment.payTypeStr ??)
                                </td>
                                <td>
                                    #(payment.payStatusStr ??)
                                </td>
                                <td>
                                    #if(payment.isCanUpdateByUser())
                                    <a href="javascript:;" onclick="updatePrice('#(payment.id)')">入账</a>
                                    #end
                                    <a href="javascript:;" onclick="showDetail('#(payment.id)')">详情</a>

                                </td>
                            </tr>
                            #else
                            <tr class="nodata"><td colspan="999">暂无数据</td> </tr>
                            #end

                            </tbody>
                        </table>
                    </div>
                    <!-- /.card-body -->

                    <div class="card-footer">
                        <div class="row">
                            <div class="offset-6 col-sm-6">
                                #@_paginate()
                            </div>
                        </div>
                    </div>
                    <!-- /.card-footer -->
                </div>
                <!-- /.card -->
            </div>
    </section>
#end
